One or more aspects of the present invention relate to data analysis technology, and more specifically, to a method and apparatus for control flow analysis.
Control flow analysis is an important aspect in performance analysis of a computer program. The basis for the control flow analysis is call relations between the respective functions of the computer program. Those skilled in the art can understand that the functions mentioned here refer to code units which can realize certain functions independently, and can be named methods etc in some situations. A calling function transfers a parameter to a called function, the called function calculates the parameter and returns a result of the calculation to the calling function. Generally, the function calling relation is recorded to be represented as a function call tree. In the function call tree, a parent node represents the calling function and the child node represents the called function. The use of the function call tree to represent the calling relation between the functions facilitates determining the function which is called frequently and the function which has excessive CPU time overhead, thereby determining the performance bottleneck of the program and further improving the performance of the program. For example, for the function which is called frequently, a more complicated optimization algorithm can be used to perform optimization or the frequency of calling that function can be reduced.
Nowadays, programs usually contain complicated business logic and thus the corresponding function call tree per se is very huge. For example, applications of a business level usually contain more than one hundred thousand invocations and more than 200 invocation levels. Since such applications are very complicated, they have many “noise calling” for auxiliary software modules in addition to actual business logics. The analysis for the huge function call tree needs a large amount of time and efforts. In addition, modern applications are generally based on a complicated framework and the business logics used are usually packaged within the framework, and thus it is difficult to separate these packaged business logics from the framework so as to perform more accurate analysis.